package com.summerbird.mallchat.common.chat.service;

import com.summerbird.mallchat.common.chat.domain.dto.MsgReadInfoDTO;
import com.summerbird.mallchat.common.chat.domain.entity.Message;
import com.summerbird.mallchat.common.chat.domain.vo.request.*;
import com.summerbird.mallchat.common.chat.domain.vo.request.member.MemberReq;
import com.summerbird.mallchat.common.chat.domain.vo.response.ChatMessageReadResp;
import com.summerbird.mallchat.common.chat.domain.vo.response.ChatMessageResp;
import com.summerbird.mallchat.common.common.domain.vo.resp.CursorPageBaseResp;
import com.summerbird.mallchat.common.websocket.domain.vo.response.ChatMemberResp;

import java.util.Collection;
import java.util.List;

public interface ChatService {
    /**
     * 发送消息
     * @param request
     * @param uid
     * @return
     */
    Long sendMsg(ChatMessageReq request, Long uid);

    /**
     * 根据消息获取消息前端展示的物料
     * @param message
     * @param receiveUid 接受消息的uid，可null
     * @return
     */
    ChatMessageResp getMsgResp(Message message, Long receiveUid);

    /**
     * 根据消息获取消息前端展示的物料
     *
     * @param msgId
     * @param receiveUid 接受消息的uid，可null
     * @return
     */
    ChatMessageResp getMsgResp(Long msgId, Long receiveUid);

    /**
     * 获取消息列表
     * @param request
     * @param receiveUid
     * @return
     */
    CursorPageBaseResp<ChatMessageResp> getMsgPage(ChatMessagePageReq request, Long receiveUid);

    /**
     * 设置消息标签
     * @param uid
     * @param request
     */
    void setMsgMark(Long uid, ChatMessageMarkReq request);

    /**
     * 撤回消息
     * @param uid
     * @param request
     */
    void recallMsg(Long uid, ChatMessageBaseReq request);

    /**
     * 阅读上报
     * @param uid
     * @param request
     */
    void msgRead(Long uid, ChatMessageMemberReq request);

    /**
     * 消息的已读未读列表
     * @param uid
     * @param request
     * @return
     */
    CursorPageBaseResp<ChatMessageReadResp> getReadPage(Long uid, ChatMessageReadReq request);

    /**
     * 获取消息已读未读总数
     * @param uid
     * @param request
     * @return
     */
    Collection<MsgReadInfoDTO> getMsgReadInfo(Long uid, ChatMessageReadInfoReq request);

    /**
     * 获取群成员信息
     * @param memberUidList
     * @param request
     * @return
     */
    CursorPageBaseResp<ChatMemberResp> getMemberPage(List<Long> memberUidList, MemberReq request);
}
